<?php
include('connect.php');
ob_start();
if(isset($_POST['email_subscribe']))
{
	$validate=mysql_query("select * from nhanphim where emailnhanphim='{$_POST['email_subscribe']}'") or die(mysql_error());
	if(mysql_num_rows($validate)==0)
	{
		if(mysql_query("insert into nhanphim values('null','{$_POST['email_subscribe']}')"))
		header("location:../index.php?key=sub");
	}
	else header("location:../index.php?key=sub_failed");
}
?>